package a.f.h.f.a;

import a.c.*;
import a.c.d;
import a.f.j.cb;
import a.i.l;

import java.util.Comparator;

public class c
  implements g
{
  private g a = null;
  private e b = null;
  private cb c;
  private q d;
  private ab e;
  private ab f;
  private ab g;
  private boolean h;
  private x i = null;
  private x j = null;
  private x k = null;
  private x m = null;
  private a.c.n o;
  private a.c.n q;
  private a.c.n r;
  public static int s;
  
  public c(g paramg)
  {
    this.a = paramg;
    this.e = new ab();
    this.f = new ab();
    this.g = new ab();
    this.h = false;
  }
  
  public void a(cb paramcb)
  {
    int i1 = e.i;
    boolean bool = e.h;
    ab localab1 = null;
    Object localObject = null;
    ab[] arrayOfab = null;
    bb localbb = new bb();
    this.c = paramcb;
    this.d = paramcb.a();
    this.i = this.d.B();
    this.j = this.d.B();
    this.k = this.d.B();
    this.m = this.d.B();
    this.r = this.d.C();
    a.c.m localm = this.d.w();
    if (localm.e()) {}
    d locald;
    do
    {
      if (i1 == 0)
      {
        if (this.b.a(localm.a()) == 0) {
          this.r.a(localm.a(), true);
        }
        localm.f();
      }
      if (!bool) {
        break;
      }
      locald = null;
      this.q = this.d.C();
    } while (i1 != 0);
    arrayOfab = a(paramcb, this.q);
    localab1 = a(this.d);
    int n = 0;
    label207:
    break label754;
    if (n < arrayOfab.length) {
      label211:
      localObject = arrayOfab[n];
    }
    label367:
    label754:
    while (i1 != 0)
    {
      if (bool) {
        break label839;
      }
      localm = localObject.l();
      if (localm.e())
      {
        if (i1 == 0)
        {
          this.d.g(localm.a());
          localm.f();
        }
      }
      else {
        for (;;)
        {
          if (!bool)
          {
            if (!bool) {
              break;
            }
            if (i1 == 0) {
              localbb.clear();
            }
          }
        }
      }
      w localw = this.d.v();
      do
      {
        if (!localw.e()) {
          break label367;
        }
        a.c.e locale = localw.d();
        if (i1 != 0) {
          break label211;
        }
        if (bool) {
          break;
        }
        if (locale.c() == 0)
        {
          localbb.add(locale);
          this.d.d(localw.d());
        }
        localw.f();
      } while (!bool);
      a.i.n.a(this, 0, "Compute Planar Subgraph for biconnected component...");
      this.a.a(this.c);
      a.i.n.a("BCC " + n + ":" + this.d);
      locald = this.c.c().a().a();
      a.i.n.a(this, 0, "Save planarization...");
      a(this.i, this.j, this.k, this.m, this.r);
      a.i.n.a(this, 0, "Store hidden edges...");
      ab localab2 = this.a.b();
      if (i1 != 0) {
        break label839;
      }
      localm = localab2.l();
      if (localm.e()) {}
      do
      {
        this.e.add(localm.a());
        if (i1 != 0) {
          break label661;
        }
        localm.f();
        if (bool) {
          break label642;
        }
        if (!bool) {
          break;
        }
        if (i1 != 0) {
          break label651;
        }
      } while (i1 != 0);
      if (this.a.a() != null) {
        localm = this.a.a().l();
      }
      while (i1 != 0)
      {
        do
        {
          if (!localm.e()) {
            break;
          }
          this.f.add(localm.a());
          localab1.add(localm.a());
          localm.f();
          if ((i1 == 0) && (bool)) {
            break label680;
          }
        } while (!bool);
        if (i1 != 0) {
          break;
        }
      }
      if (this.a.c() != null) {
        this.g.a(this.a.c());
      }
      localw = localbb.l();
      do
      {
        if (!localw.e()) {
          break;
        }
        this.d.e(localw.d());
        localw.f();
        if (i1 != 0) {
          break label754;
        }
        if (bool) {
          break label747;
        }
      } while (!bool);
      if (i1 == 0) {
        localm = this.d.w();
      }
      do
      {
        if (!localm.e()) {
          break label817;
        }
        if (bool) {
          break;
        }
        if (this.c.h(localm.a())) {
          localab1.add(localm.a());
        }
        this.d.f(localm.a());
        localm.f();
      } while (!bool);
      n++;
      if (i1 != 0) {
        break label207;
      }
      if (!bool) {
        break;
      }
    }
    label642:
    label651:
    label661:
    label680:
    label747:
    localm = localab1.l();
    label817:
    label839:
    do
    {
      do
      {
        if (!localm.e()) {
          break;
        }
        this.d.g(localm.a());
        localm.f();
        if (i1 != 0) {
          break label908;
        }
        if (bool) {
          break label901;
        }
      } while (!bool);
    } while (i1 != 0);
    localm = this.e.l();
    label901:
    label908:
    if (localm.e()) {}
    do
    {
      this.d.f(localm.a());
      localm.f();
      if ((i1 == 0) && (bool)) {
        return;
      }
      if (!bool) {
        break;
      }
      f();
      this.c.f();
      this.c.a(this.c.c(locald));
      this.h = true;
    } while (i1 != 0);
    g();
  }
  
  public ab b()
  {
    if ((e.i != 0) || (this.h)) {
      return this.e;
    }
    throw new RuntimeException("Invalid Execution Order: call 'createPlanarization' first!");
  }
  
  private void a(x paramx1, x paramx2, x paramx3, x paramx4, a.c.n paramn)
  {
    int i1 = e.i;
    boolean bool = e.h;
    w localw = this.d.v();
    label311:
    label472:
    label474:
    label510:
    do
    {
      if (!localw.e()) {
        break;
      }
      a.c.e locale = localw.d();
      d locald1 = this.b.a(locale);
      d locald2 = this.b.b(locale);
      ab localab1;
      ab localab2;
      Object localObject;
      do
      {
        localab1 = (ab)paramx1.get(locale);
        if (i1 == 0) {
          if (localab1 == null) {
            localab1 = new ab();
          }
        }
        localab2 = (ab)paramx2.get(locale);
        if (i1 == 0) {
          if (localab2 == null) {
            localab2 = new ab();
          }
        }
        ab localab3 = (ab)paramx3.get(locale);
        if (i1 == 0) {
          if (localab3 == null) {
            localab3 = new ab();
          }
        }
        ab localab4 = (ab)paramx4.get(locale);
        if ((i1 != 0) || (localab4 == null)) {
          localab4 = new ab();
        }
        int n = 1;
        localObject = locale.n();
        do
        {
          if (!((a.c.m)localObject).e()) {
            break;
          }
          if (bool) {
            break label311;
          }
          if (!this.r.getBool(((a.c.m)localObject).a()))
          {
            if (i1 != 0) {
              continue;
            }
            if (!this.r.getBool(this.c.b(((a.c.m)localObject).a())))
            {
              n = 0;
              if (i1 != 0) {
                continue;
              }
              if (!bool) {
                break;
              }
            }
          }
          ((a.c.m)localObject).f();
        } while (!bool);
        if (i1 == 0) {
          if (((i1 == 0) && (locald1 != null)) || ((locald2 == null) || (n != 0)))
          {
            if (localab3.size() < localab4.size())
            {
              localObject = locale.n();
              do
              {
                if (!((a.c.m)localObject).e()) {
                  break;
                }
                localab3.add(((a.c.m)localObject).a());
                ((a.c.m)localObject).f();
                if (i1 != 0) {
                  break label396;
                }
                if (bool) {
                  break label394;
                }
              } while (!bool);
              if (i1 != 0) {
                break label699;
              }
              paramx3.a(locale, localab3);
              if (i1 != 0) {
                break label713;
              }
              if (!bool) {
                break label704;
              }
            }
            localObject = locale.n();
            do
            {
              if (!((a.c.m)localObject).e()) {
                break;
              }
              localab4.add(((a.c.m)localObject).a());
              ((a.c.m)localObject).f();
              if (i1 != 0) {
                break label474;
              }
              if (bool) {
                break label472;
              }
            } while (!bool);
            if (i1 != 0) {
              break label699;
            }
            paramx4.a(locale, localab4);
            if (i1 != 0) {
              break label713;
            }
            if (!bool) {
              break label704;
            }
          }
        }
        if (i1 != 0) {
          break label633;
        }
        if (locald1 == null) {
          break;
        }
        localObject = new ab();
        a.c.m localm1 = locale.b(locald1);
        break label544;
        ((ab)localObject).a(localm1.a());
        localm1.b();
        do
        {
          if (localm1.a() != locald1) {
            if (localm1.a() != locald2) {
              break label510;
            }
          }
          if (i1 != 0) {
            break;
          }
        } while (bool);
        a.c.m localm2 = ((ab)localObject).l();
        do
        {
          if (!localm2.e()) {
            break;
          }
          localab1.a(localm2.a());
          localm2.f();
          if ((i1 == 0) && (bool)) {
            break label631;
          }
        } while (!bool);
      } while (i1 != 0);
      paramx1.a(locale, localab1);
      if (locald2 != null)
      {
        localObject = locale.b(locald2);
        do
        {
          while ((((a.c.m)localObject).a() != locald1) && (((a.c.m)localObject).a() != locald2))
          {
            localab2.add(((a.c.m)localObject).a());
            ((a.c.m)localObject).b();
          }
        } while (bool);
        paramx2.a(locale, localab2);
      }
      localw.f();
    } while (!bool);
    label394:
    label396:
    label544:
    label631:
    label633:
    return;
  }
  
  private void f()
  {
    int n = e.i;
    boolean bool = e.h;
    ab localab1 = null;
    a.c.m localm = null;
    w localw = this.d.v();
    label149:
    label163:
    label304:
    do
    {
      if (!localw.e()) {
        break;
      }
      a.c.e locale = localw.d();
      ab localab2 = new ab();
      ab localab3 = (ab)this.i.get(locale);
      if ((n != 0) || (localab3 != null)) {
        if (n == 0) {
          if (localab3.isEmpty()) {
            break label149;
          }
        }
      }
      while (n != 0)
      {
        this.b.a(locale, localab3.m());
        localm = localab3.l();
        do
        {
          if (!localm.e()) {
            break label163;
          }
          localab2.add(localm.a());
          localm.f();
          if ((n == 0) && (bool)) {
            break;
          }
        } while (!bool);
      }
      do
      {
        this.b.a(locale, null);
        ab localab4 = (ab)this.m.get(locale);
        if (n == 0)
        {
          if (localab4 != null) {
            localab2.addAll(localab4);
          }
          if (n == 0) {
            localab1 = (ab)this.j.get(locale);
          }
        }
        else if (localab1 != null)
        {
          if (n == 0)
          {
            if (!localab1.isEmpty()) {
              this.b.c(locale, localab1.m());
            }
          }
          else
          {
            localm = localab1.l();
            do
            {
              if (!localm.e()) {
                break label304;
              }
              localab2.add(localm.a());
              localm.f();
              if ((n == 0) && (bool)) {
                break;
              }
            } while (!bool);
          }
        }
      } while (n != 0);
      this.b.c(locale, null);
      ab localab5 = (ab)this.k.get(locale);
      if (n == 0)
      {
        if (localab5 != null) {
          localab2.addAll(localab5);
        }
        locale.b(new Comparator()
        {
          private final ab val$sortedEdges;
          
          public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
          {
            d locald1 = (d)paramAnonymousObject1;
            d locald2 = (d)paramAnonymousObject2;
            return l.a(this.val$sortedEdges.indexOf(locald1), this.val$sortedEdges.indexOf(locald2));
          }
        });
        localw.f();
      }
    } while (!bool);
  }
  
  public ab a()
  {
    return this.f;
  }
  
  public a.c.m c()
  {
    return this.g.l();
  }
  
  protected ab[] a(cb paramcb, a.c.n paramn)
  {
    int n = a.a.m.a(paramcb.a(), paramn);
    return a.a.m.a(paramcb.a(), paramn, n);
  }
  
  private ab a(q paramq)
  {
    int n = e.i;
    boolean bool = e.h;
    d locald = null;
    ab localab = new ab();
    a.c.m localm = paramq.w();
    localm.h();
    if (localm.e()) {
      locald = localm.a();
    }
    while (n != 0)
    {
      if (n == 0)
      {
        if (bool) {
          break label90;
        }
        localab.add(locald);
        paramq.f(locald);
        localm.f();
      }
      if (!bool) {
        break;
      }
    }
    label90:
    return localab;
  }
  
  public void g()
  {
    this.d.a(this.i);
    this.d.a(this.j);
    this.d.a(this.q);
    this.d.a(this.k);
    this.d.a(this.m);
    this.d.a(this.r);
  }
  
  public void a(e parame)
  {
    this.b = parame;
  }
  
  public void a(a.c.n paramn)
  {
    this.o = paramn;
  }
  
  public a.c.e d()
  {
    return null;
  }
  
  public a.c.e e()
  {
    return null;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.h.f.a.c

 * JD-Core Version:    0.7.0.1

 */